var obj = {
    a:1
}
function foo(){
    console.log(this.a);
}
foo.call(obj)

Function.prototype.mycall = function(){
    //拿到foo
    //将foo引用到obj上
    //让obj触发foo
    //移除掉obj上的foo

    //arguments
    const context = arguments[0]
    const args = Array.from(arguments).slice(1) //[]
    context.fn = this 
    const res = context.fn(...args)
    delete context.fn
    return res 
}

foo.mycall(obj)